﻿using CoreShop.Library;
using FastMember;
using Sunny.UI;
using System.Windows.Forms;

namespace CoreShop.App
{
    public partial class FButtons : UIForm
    {
        public FButtons()
        {
            InitializeComponent();
        }

        private void uiButton1_Click(object sender, System.EventArgs e)
        {
            uiMultiButtons1.Clear();
            uiMultiButtons1.AutoWidth = true;
            uiMultiButtons1.Add("未按要求制作", 1);
            uiMultiButtons1.Add("不新鲜", 2);
            uiMultiButtons1.Add("发现异物", 3);
            uiMultiButtons1.Add("上菜慢", 4);
            uiMultiButtons1.Add("错点", 5);
            uiMultiButtons1.Add("其他", 6);
        }

        private void uiIntegerUpDown1_ValueChanged(object sender, int value)
        {
            uiMultiButtons1.MaxSelected = value;
        }

        private void uiButton2_Click(object sender, System.EventArgs e)
        {
            uiMultiButtons1.Clear();
            uiMultiButtons1.AutoWidth = false;
            uiMultiButtons1.ItemSize = new System.Drawing.Size(130, 40);
            uiMultiButtons1.Add("未按要求制作", 1);
            uiMultiButtons1.Add("不新鲜", 2);
            uiMultiButtons1.Add("发现异物", 3);
            uiMultiButtons1.Add("上菜慢", 4);
            uiMultiButtons1.Add("错点", 5);
            uiMultiButtons1.Add("其他", 6);
        }

        private void uiMultiButtons1_OnOverSelectedCount(object sender, System.EventArgs e)
        {
            UIMessageTip.ShowWarning("可选中数量已经超过" + uiMultiButtons1.MaxSelected + "个，请重新选择。");
        }

        private void uiMultiButtons1_SelectedChanged(object sender, System.EventArgs e)
        {
            uiListBox1.Items.Clear();
            uiListBox1.Items.AddRange(uiMultiButtons1.SelectedButtons);
        }

        private void uiButton3_Click(object sender, System.EventArgs e)
        {

            yzPanel1.Controls.Add(payItemName);
            yzPanel1.Controls.Add(uiSymbolButton1); 
        }

        private void btnCash_Click(object sender, System.EventArgs e)
        {
            try
            {
                btnCash.Selected = false;
                btnWechatPay.Selected = false;
                btnAliPay.Selected = false;
                btnUnionPay.Selected = false;
                btnMemberPay.Selected = false;
                btnCoupon.Selected = false;
                btnTiktokPay.Selected = false;
                (sender as UIImageButton).Selected = true;
            }
            catch { }
            finally
            {

            }
        }
    }
}
